package com.sfac.springBoot.module.account.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sfac.springBoot.module.account.pojo.Role;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * personal demo
 **/

@Mapper
@Repository
public interface RoleDao extends BaseMapper<Role> {



    @Select("select * from account_role ar left join account_user_role aur on ar.id = aur.role_id "
            + "where aur.user_id = #{userId}")
    List<Role> getRolesByUserId(Integer id);
}
